$(function(){



    var login = new Vue({
        el: '#result-content',
        data:{
            resultMsg : "",
            resultWarn : "",
            src:"",
            time:8,
            typeList : [
                {msg:"恭喜您注册成功!",warn:"s后自动跳转",src:"image/chenggong.png"},
                {msg:"注册失败!",warn:"s后自动跳转",src:"image/shibai.png"},
                {msg:"密码重置成功!",warn:"s后自动跳转至登录页面",src:"image/chenggong.png"}
                ],
        },
        methods:{
            goRegister: function(){
                location.href = 'register.html';
            },
            goResetPassword: function(){
                location.href = 'resetPassword.html';
            },
        },
        mounted:function(){
          this.$nextTick(function(){
                var args = getUrlParams();
                if(args.type){
                    this.resultMsg = this.typeList[args.type].msg;
                    this.resultWarn = this.typeList[args.type].warn;
                    this.src = this.typeList[args.type].src;
                    setInterval(function(){
                        if(login.time > 1){
                            login.time--;
                        }else{
                            history.back();
                        }
                    },1000);
                }else{
                    location.href = "index.html";
                }
          });
        },
    });

});